/**
 * 
 */
package com.flymobi.playmobile.adapter;

import java.util.List;
import java.util.Map;

import com.flymobi.playmobile.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ShopListAdapter extends BaseAdapter {
	private List<Map<String, Object>> list=null;
	private Context context;

	public ShopListAdapter(Context context,List<Map<String, Object>> list) {
		this.context=context;
		this.list=list;
	}

	public int getCount() {
		if(list==null){
			return 0;
		}
		return  list.size();
	}

	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}
	private TextView name;
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		convertView = View.inflate(context, R.layout.shopitem, null);
		name = (TextView) convertView.findViewById(R.id.name);
		if(list!=null){
			Map<String, Object> map = list.get(position);
			name.setText(map.get("name").toString());
		}
		return convertView;
	}

	
}

